import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

public class demo2 {
    public static void main(String[] args) {
        Student s1 = new Student("刘德华",22);
        Student s2 = new Student("梁朝伟",24);
        Student s3 = new Student("吴彦祖",26);
        Student s4 = new Student("大师",99);

        ArrayList<Student> arrayList = new ArrayList<>();
        arrayList.add(s1);
        arrayList.add(s2);
        arrayList.add(s3);
        arrayList.add(s4);

        System.out.println(arrayList.indexOf(s2));
        System.out.println(arrayList.indexOf(s3));
    }
}